﻿using STHPMS1.ICore.I_Entity.Info;
using STHPMS1.ICore.I_Entity.Stmpms1;
using STHPMS1.ICore.I_Serv;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq.Expressions;

namespace STHPMS1.ICore.I_BLL.Bus
{
    public interface IDm_ModelgroupBill : IBll
    {
        void Save<T>(T entity) 
            where T:class ,IDm_Modelgroup;

        void Remove(IDm_Modelgroup entity);

        IEnumerable<T> Get<T>(Expression<Func<T, bool>> predicate, IPagingInfo info)
            where T : class, IDm_Modelgroup;

       /// <summary>
       /// 根据模型获取决策路段在某一年的PCI指标值
       /// 求出的是实际年限的PCI值
       /// </summary>
       /// <param name="result">决策路段</param>
       /// <param name="year">年</param>
       /// <returns>返回决策路段某年的PCI值</returns>
        double GetPciByModel(IDn_Divi_Result result, int year);
        /// <summary>
        /// 根据模型获取决策路段在某一年累计当量轴载次数
        /// </summary>
        /// <param name="result">决策路段</param>
        /// <param name="year">年</param>
        /// <returns>返回决策路段某年的累计当量轴载</returns>
        double GetEaslByModel(IDn_Divi_Result result, int year);
        /// <summary>
        /// 获取所有模型数据
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        DataTable GetAllModelGroups<T>( string predicate, IPagingInfo info,bool? check = null)
            where T : class, IDm_Modelgroup;

        /// <summary>
        /// 查看模型详细信息
        /// </summary>
        /// <param name="modelId"></param>
        /// <returns></returns>
        dynamic GetModelDetail(string modelId);
        /// <summary>
        /// 模型回归计算
        /// </summary>
        /// <param name="modelId"></param>
        /// <param name="modelMode"></param>
        /// <param name="beginYear"></param>
        /// <param name="endYear"></param>
        void CalcReturn(string modelId, int modelMode, int beginYear, int endYear);
        /// <summary>
        /// 获取模型绘制对象
        /// </summary>
        /// <param name="modelId"></param>
        /// <returns></returns>
        List<Object> GetModelGraphic(string modelId);
        /// <summary>
        /// 统一加载数据
        /// </summary>
        void LoadData();
        /// <summary>
        /// 统一卸载数据
        /// </summary>
        void UnloadData();
    }
}
